Hi all,
I'm trying to upload images to my project Phalcon with Dropzone 4.2.0, but all data captured while trying to $ file-> moveTo () I get an error but not what is.
FileController - uploadAction
public function uploadAction () {
//elimina renderizado al ser un ajax
$this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_NO_RENDER);
//comprueba si hay archivos por subir
if ($this->request->hasFiles() == true) {
// Print the real file names and sizes
foreach ($this->request->getUploadedFiles() as $file) {
echo $file->getName(), " ", $file->getSize(), "\n";
$fileObj = new Files();
$fileObj->name = $file->getName();
$fileObj->size = round(($file->getSize()/1024),2);
$fileObj->type = Files::IMG;
$fileObj->of = "Homes";
$fileObj->ofId = $this->request->getPost('ofId');
$fileObj->save();
$file->moveTo('img/' . $file->getName());
echo "<br>" ;
echo $file->getError();
}
}
}
Notes:
- $file->getError() give me 1
- img folder in public is 777
How I can know that errors occur?
Thanks for the help :)